package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.TDailyPlanMapper;
import com.ruoyi.business.domain.TDailyPlan;
import com.ruoyi.business.service.ITDailyPlanService;

/**
 * 每日计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-12
 */
@Service
public class TDailyPlanServiceImpl implements ITDailyPlanService 
{
    @Autowired
    private TDailyPlanMapper tDailyPlanMapper;

    /**
     * 查询每日计划
     * 
     * @param id 每日计划主键
     * @return 每日计划
     */
    @Override
    public TDailyPlan selectTDailyPlanById(String id)
    {
        return tDailyPlanMapper.selectTDailyPlanById(id);
    }

    @Override
    public TDailyPlan selectTDailyPlanByPatientId(TDailyPlan tDailyPlan)
    {
        return tDailyPlanMapper.selectTDailyPlanByPatientId(tDailyPlan);
    }

    /**
     * 查询每日计划列表
     * 
     * @param tDailyPlan 每日计划
     * @return 每日计划
     */
    @Override
    public List<TDailyPlan> selectTDailyPlanList(TDailyPlan tDailyPlan)
    {
        return tDailyPlanMapper.selectTDailyPlanList(tDailyPlan);
    }

    /**
     * 新增每日计划
     * 
     * @param tDailyPlan 每日计划
     * @return 结果
     */
    @Override
    public int insertTDailyPlan(TDailyPlan tDailyPlan)
    {
        tDailyPlan.setCreateTime(DateUtils.getNowDate());
        return tDailyPlanMapper.insertTDailyPlan(tDailyPlan);
    }

    /**
     * 修改每日计划
     * 
     * @param tDailyPlan 每日计划
     * @return 结果
     */
    @Override
    public int updateTDailyPlan(TDailyPlan tDailyPlan)
    {
        tDailyPlan.setUpdateTime(DateUtils.getNowDate());
        return tDailyPlanMapper.updateTDailyPlan(tDailyPlan);
    }

    /**
     * 批量删除每日计划
     * 
     * @param ids 需要删除的每日计划主键
     * @return 结果
     */
    @Override
    public int deleteTDailyPlanByIds(String[] ids)
    {
        return tDailyPlanMapper.deleteTDailyPlanByIds(ids);
    }

    /**
     * 删除每日计划信息
     * 
     * @param id 每日计划主键
     * @return 结果
     */
    @Override
    public int deleteTDailyPlanById(String id)
    {
        return tDailyPlanMapper.deleteTDailyPlanById(id);
    }
}
